﻿using EShop.Net.Configuration;
using SKIT.FlurlHttpClient;
using SKIT.FlurlHttpClient.Wechat.Api;

namespace EShop.Net.WeChar.Client
{
    /// <summary>
    ///********************************************
    /// 类    名 ：WechatApiClientFactory
    /// 功能描述 ：
    /// 创 建 人 ：十一
    /// 创建时间 ：2022/11/9 23:34:37
    ///******************************************/
    /// </summary>
    public class WechatApiClientFactory
    {
        public WechatApiClient CreateWxClient()
        {
            var client = new WechatApiClient(new WechatApiClientOptions()
            {
                AppId = AppSettingsConstVars.WeCharAppId,
                AppSecret = AppSettingsConstVars.WeCharAppSecret
            });
            client.Configure(settings =>
            {
                settings.JsonSerializer = new FlurlNewtonsoftJsonSerializer();
            });
            return client;
        }
    }
}
